﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_CapNhatSoDuDauKyTaiKhoan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvBoPhan")]
        private ADVList _AdvBoPhan;
        [AccessedThroughProperty("AdvDoiTuong")]
        private ADVObjects _AdvDoiTuong;
        [AccessedThroughProperty("AdvHopDong")]
        private ADVList _AdvHopDong;
        [AccessedThroughProperty("AdvSanPham")]
        private ADVList _AdvSanPham;
        [AccessedThroughProperty("AdvTaiKhoan")]
        private ADVAccount _AdvTaiKhoan;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("TxtSoDuCo")]
        private C1NumericEdit _TxtSoDuCo;
        [AccessedThroughProperty("TxtSoDuCoNT")]
        private C1NumericEdit _TxtSoDuCoNT;
        [AccessedThroughProperty("TxtSoDuNo")]
        private C1NumericEdit _TxtSoDuNo;
        [AccessedThroughProperty("TxtSoDuNoNT")]
        private C1NumericEdit _TxtSoDuNoNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        private string cFrmFormat;
        public string cFrmKhoa;
        public string cFrmNamThang;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowDel;
        private bool mAllowEdit;
        private ClsSoDuDauKyTaiKhoan objSDDKTK;

        public Frm_CapNhatSoDuDauKyTaiKhoan()
        {
            base.Load += new EventHandler(this.Frm_CapNhatSoDuDauKyTaiKhoan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoa = "";
            this.cFrmNamThang = "";
            this.cFrmTask = "";
            this.mAllowEdit = true;
            this.mAllowDel = false;
            this.objSDDKTK = new ClsSoDuDauKyTaiKhoan();
            this.InitializeComponent();
        }

        private void AdvTaiKhoan_ValueChanged(object sender, EventArgs e)
        {
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            if (khoan.Load(this.AdvTaiKhoan.Value))
            {
                this.CboLoaiTien.SelectedValue = khoan.LoaiTien;
                this.CboLoaiTien_SelectedIndexChanged(RuntimeHelpers.GetObjectValue(sender), e);
                if ((((khoan.DoiTuongCungCap + khoan.DoiTuongKhachHang) + khoan.DoiTuongNganHang) + khoan.DoiTuongNhanVien) == 0)
                {
                    this.AdvDoiTuong.Value = "";
                    this.AdvDoiTuong.ReadOnly = true;
                }
                else
                {
                    if (khoan.DoiTuongCungCap == 1)
                    {
                        this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
                    }
                    if (khoan.DoiTuongKhachHang == 1)
                    {
                        this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
                    }
                    if (khoan.DoiTuongNganHang == 1)
                    {
                        this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.NganHang;
                    }
                    if (khoan.DoiTuongNhanVien == 1)
                    {
                        this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
                    }
                    this.AdvDoiTuong.ReadOnly = false;
                }
                if (khoan.TaiKhoanGiaThanh == 1)
                {
                    this.AdvBoPhan.ReadOnly = true;
                    this.AdvSanPham.ReadOnly = true;
                    this.AdvHopDong.ReadOnly = true;
                    if (khoan.SanPham == 1)
                    {
                        this.AdvSanPham.ReadOnly = false;
                    }
                    if (khoan.HopDong == 1)
                    {
                        this.AdvHopDong.ReadOnly = false;
                    }
                    if (khoan.BoPhan == 1)
                    {
                        this.AdvBoPhan.ReadOnly = false;
                    }
                }
                else
                {
                    this.AdvBoPhan.ReadOnly = true;
                    this.AdvSanPham.ReadOnly = true;
                    this.AdvHopDong.ReadOnly = true;
                }
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = this.CboLoaiTien.SelectedValue.ToString();
                clsDMLoaiTien tien = new clsDMLoaiTien();
                tien.LoadByCode(strCode);
                this.txtTyGia.Value = tien.TyGia;
                if (tien.SoLe > 0)
                {
                    this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", tien.SoLe);
                }
                this.FormatNumber();
                if (tien.TienViet == 1)
                {
                    this.txtTyGia.Enabled = false;
                }
            }
        }

        public bool checkIvalid()
        {
            if (LVYModule.ReturnIfNull(this.AdvTaiKhoan.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                bool flag=false;
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nh\x00e2̣p số t\x00e0i khoản trước!", ""));
                this.AdvTaiKhoan.Focus();
                return flag;
            }
            if (this.CboLoaiTien.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            khoan.Load(this.AdvTaiKhoan.Value);
            if ((khoan.DoiTuongNganHang != 0) & (this.AdvDoiTuong.Value.Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn ng\x00e2n h\x00e0ng để t\x00ednh số dư quỹ!", ""));
                this.AdvDoiTuong.Focus();
                return false;
            }
            if ((((khoan.DoiTuongNhanVien + khoan.DoiTuongKhachHang) + khoan.DoiTuongCungCap) != 0) && (this.AdvDoiTuong.Value.Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập đối tượng để ghi c\x00f4ng nợ!", ""));
                this.AdvDoiTuong.Focus();
                return false;
            }
            if (this.TxtSoDuNoNT.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số dư nợ!", ""));
                this.TxtSoDuNoNT.Focus();
                return false;
            }
            if (this.TxtSoDuNoNT.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số dư c\x00f3!", ""));
                this.TxtSoDuCoNT.Focus();
                return false;
            }
            return true;
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            if (this.checkIvalid())
            {
                this.TxtSoDuNoNT_LostFocus(this.TxtSoDuNoNT, e);
                this.TxtSoDuCoNT_LostFocus(this.TxtSoDuCoNT, e);
                this.Save();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.AdvTaiKhoan.Value = "";
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.AdvDoiTuong.Value = "";
            this.AdvBoPhan.Value = "";
            this.AdvHopDong.Value = "";
            this.AdvSanPham.Value = "";
            this.TxtSoDuCo.Value = 0;
            this.TxtSoDuCoNT.Value = 0;
            this.TxtSoDuNo.Value = 0;
            this.TxtSoDuNoNT.Value = 0;
            this.AdvTaiKhoan.Focus();
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoDuNoNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoDuNo, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtSoDuCoNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoDuCo, modGeneral.H_FORMATNUMBER);
        }

        private void Frm_CapNhatSoDuDauKyTaiKhoan_Load(object sender, EventArgs e)
        {
            BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
            this.cFrmFormat = modGeneral.H_FORMATNUMBER;
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
                this.cFrmKhoa = modGeneral.CreatKey("GL_SoDuDauKyTaiKhoan", 15, "");
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_CapNhatSoDuDauKyTaiKhoan));
            this.GroupBox1 = new GroupBox();
            this.TxtSoDuCo = new C1NumericEdit();
            this.Label5 = new Label();
            this.TxtSoDuCoNT = new C1NumericEdit();
            this.Label9 = new Label();
            this.TxtSoDuNo = new C1NumericEdit();
            this.Label3 = new Label();
            this.TxtSoDuNoNT = new C1NumericEdit();
            this.Label2 = new Label();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.Label6 = new Label();
            this.Label4 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label1 = new Label();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.AdvHopDong = new ADVList();
            this.AdvSanPham = new ADVList();
            this.AdvBoPhan = new ADVList();
            this.AdvDoiTuong = new ADVObjects();
            this.AdvTaiKhoan = new ADVAccount();
            this.GroupBox1.SuspendLayout();
            ((ISupportInitialize) this.TxtSoDuCo).BeginInit();
            ((ISupportInitialize) this.TxtSoDuCoNT).BeginInit();
            ((ISupportInitialize) this.TxtSoDuNo).BeginInit();
            ((ISupportInitialize) this.TxtSoDuNoNT).BeginInit();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.SuspendLayout();
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.TxtSoDuCo);
            this.GroupBox1.Controls.Add(this.Label5);
            this.GroupBox1.Controls.Add(this.TxtSoDuCoNT);
            this.GroupBox1.Controls.Add(this.Label9);
            this.GroupBox1.Controls.Add(this.TxtSoDuNo);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.TxtSoDuNoNT);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.AdvHopDong);
            this.GroupBox1.Controls.Add(this.AdvSanPham);
            this.GroupBox1.Controls.Add(this.AdvBoPhan);
            this.GroupBox1.Controls.Add(this.Label8);
            this.GroupBox1.Controls.Add(this.Label7);
            this.GroupBox1.Controls.Add(this.Label6);
            this.GroupBox1.Controls.Add(this.AdvDoiTuong);
            this.GroupBox1.Controls.Add(this.Label4);
            this.GroupBox1.Controls.Add(this.CboLoaiTien);
            this.GroupBox1.Controls.Add(this.txtTyGia);
            this.GroupBox1.Controls.Add(this.Label11);
            this.GroupBox1.Controls.Add(this.Label10);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.AdvTaiKhoan);
            Point point = new Point(7, 2);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x1be, 0xf1);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 1;
            this.GroupBox1.TabStop = false;
            this.TxtSoDuCo.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoDuCo.DataType = typeof(double);
            this.TxtSoDuCo.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x145, 0xd4);
            this.TxtSoDuCo.Location = point;
            this.TxtSoDuCo.Name = "TxtSoDuCo";
            Padding padding = new Padding(1);
            this.TxtSoDuCo.Padding = padding;
            this.TxtSoDuCo.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtSoDuCo.Size = size;
            this.TxtSoDuCo.TabIndex = 120;
            this.TxtSoDuCo.Tag = null;
            this.TxtSoDuCo.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuCo.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoDuCo.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtSoDuCo.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label5.AutoSize = true;
            point = new Point(0xfc, 0xd8);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x2c, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x79;
            this.Label5.Text = "Quy đổi";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.TxtSoDuCoNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoDuCoNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x6c, 0xd4);
            this.TxtSoDuCoNT.Location = point;
            this.TxtSoDuCoNT.Name = "TxtSoDuCoNT";
            padding = new Padding(1);
            this.TxtSoDuCoNT.Padding = padding;
            size = new Size(0x70, 20);
            this.TxtSoDuCoNT.Size = size;
            this.TxtSoDuCoNT.TabIndex = 8;
            this.TxtSoDuCoNT.Tag = null;
            this.TxtSoDuCoNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuCoNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoDuCoNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtSoDuCoNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label9.AutoSize = true;
            point = new Point(8, 0xd7);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            size = new Size(50, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x77;
            this.Label9.Text = "Số dư c\x00f3";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.TxtSoDuNo.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoDuNo.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x145, 0xb9);
            this.TxtSoDuNo.Location = point;
            this.TxtSoDuNo.Name = "TxtSoDuNo";
            padding = new Padding(1);
            this.TxtSoDuNo.Padding = padding;
            this.TxtSoDuNo.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtSoDuNo.Size = size;
            this.TxtSoDuNo.TabIndex = 0x74;
            this.TxtSoDuNo.Tag = null;
            this.TxtSoDuNo.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuNo.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoDuNo.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtSoDuNo.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label3.AutoSize = true;
            point = new Point(0xfc, 0xbd);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x2c, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x75;
            this.Label3.Text = "Quy đổi";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.TxtSoDuNoNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoDuNoNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x6c, 0xb9);
            this.TxtSoDuNoNT.Location = point;
            this.TxtSoDuNoNT.Name = "TxtSoDuNoNT";
            padding = new Padding(1);
            this.TxtSoDuNoNT.Padding = padding;
            size = new Size(0x70, 20);
            this.TxtSoDuNoNT.Size = size;
            this.TxtSoDuNoNT.TabIndex = 7;
            this.TxtSoDuNoNT.Tag = null;
            this.TxtSoDuNoNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuNoNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoDuNoNT.VisualStyle = VisualStyle.Office2007Blue;
            this.TxtSoDuNoNT.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label2.AutoSize = true;
            point = new Point(8, 0xbc);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(50, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x73;
            this.Label2.Text = "Số dư nợ";
            this.Label2.TextAlign = ContentAlignment.TopRight;
            this.Label8.AutoSize = true;
            point = new Point(8, 160);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x37, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x71;
            this.Label8.Text = "Hợp đồng";
            this.Label7.AutoSize = true;
            point = new Point(8, 0x83);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x37, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x70;
            this.Label7.Text = "Sản phẩm";
            this.Label6.AutoSize = true;
            point = new Point(9, 0x66);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x2f, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x6f;
            this.Label6.Text = "Bộ phận";
            this.Label4.AutoSize = true;
            point = new Point(9, 0x4a);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x35, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 110;
            this.Label4.Text = "Đối tượng";
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x6c, 0x2b);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x70, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 1;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x145, 0x2b);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x68, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 2;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            point = new Point(8, 0x2e);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x3d;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0xfc, 0x2e);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 60;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label1.AutoSize = true;
            point = new Point(8, 0x13);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x37, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 2;
            this.Label1.Text = "T\x00e0i khoản";
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x176, 250);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 10;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x123, 250);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4e, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 9;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.AdvHopDong.LoaiDanhMuc = ADVList.ListDanhMuc.HopDong;
            point = new Point(0x6c, 0x9d);
            this.AdvHopDong.Location = point;
            this.AdvHopDong.Name = "AdvHopDong";
            this.AdvHopDong.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvHopDong.Size = size;
            this.AdvHopDong.TabIndex = 6;
            this.AdvHopDong.UpperText = true;
            this.AdvHopDong.Value = "";
            this.AdvHopDong.WidthCode = 80;
            this.AdvSanPham.LoaiDanhMuc = ADVList.ListDanhMuc.SanPham;
            point = new Point(0x6c, 0x80);
            this.AdvSanPham.Location = point;
            this.AdvSanPham.Name = "AdvSanPham";
            this.AdvSanPham.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvSanPham.Size = size;
            this.AdvSanPham.TabIndex = 5;
            this.AdvSanPham.UpperText = true;
            this.AdvSanPham.Value = "";
            this.AdvSanPham.WidthCode = 80;
            this.AdvBoPhan.LoaiDanhMuc = ADVList.ListDanhMuc.BoPhan;
            point = new Point(0x6c, 0x63);
            this.AdvBoPhan.Location = point;
            this.AdvBoPhan.Name = "AdvBoPhan";
            this.AdvBoPhan.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvBoPhan.Size = size;
            this.AdvBoPhan.TabIndex = 4;
            this.AdvBoPhan.UpperText = true;
            this.AdvBoPhan.Value = "";
            this.AdvBoPhan.WidthCode = 80;
            this.AdvDoiTuong.Conditions = "";
            this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.TatCa;
            point = new Point(0x6c, 0x47);
            this.AdvDoiTuong.Location = point;
            this.AdvDoiTuong.Name = "AdvDoiTuong";
            this.AdvDoiTuong.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvDoiTuong.Size = size;
            this.AdvDoiTuong.TabIndex = 3;
            this.AdvDoiTuong.UpperText = true;
            this.AdvDoiTuong.Value = "";
            this.AdvDoiTuong.WidthCode = 80;
            this.AdvTaiKhoan.Conditions = "IsNull(DoiTuongNhanVien,0) = 0 And IsNull(DoiTuongCungCap,0) = 0 and IsNull(DoiTuongKhachHang,0) = 0 and Left(SoTaiKhoan,3) not IN (131,141,331,338,341,151,152,153,155,156,157)";
            this.AdvTaiKhoan.DefaultValue = "";
            this.AdvTaiKhoan.FieldNameFilter = "";
            this.AdvTaiKhoan.KeyFilter = "";
            point = new Point(0x6c, 0x10);
            this.AdvTaiKhoan.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoan.Margin = padding;
            this.AdvTaiKhoan.Name = "AdvTaiKhoan";
            this.AdvTaiKhoan.OnlyDigit = false;
            this.AdvTaiKhoan.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvTaiKhoan.Size = size;
            this.AdvTaiKhoan.TabIndex = 0;
            this.AdvTaiKhoan.UpperText = true;
            this.AdvTaiKhoan.Value = "";
            this.AdvTaiKhoan.WithCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x1ce, 280);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.GroupBox1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_CapNhatSoDuDauKyTaiKhoan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "CAP NHAT SO DU DAU KY TAI KHOAN";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            ((ISupportInitialize) this.TxtSoDuCo).EndInit();
            ((ISupportInitialize) this.TxtSoDuCoNT).EndInit();
            ((ISupportInitialize) this.TxtSoDuNo).EndInit();
            ((ISupportInitialize) this.TxtSoDuNoNT).EndInit();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.ResumeLayout(false);
        }

        public void Save()
        {
            if (this.checkIvalid())
            {
                ClsSoDuDauKyTaiKhoan objSDDKTK = this.objSDDKTK;
                objSDDKTK.Khoa = this.cFrmKhoa;
                objSDDKTK.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
                objSDDKTK.TyGia = Conversions.ToDouble(this.txtTyGia.Value);
                objSDDKTK.NamThang = this.cFrmNamThang;
                objSDDKTK.KhoaTaiKhoan = this.AdvTaiKhoan.Value;
                objSDDKTK.KhoaDoiTuong = this.AdvDoiTuong.Value;
                objSDDKTK.KhoaBoPhan = this.AdvBoPhan.Value;
                objSDDKTK.KhoaSanPham = this.AdvSanPham.Value;
                objSDDKTK.KhoaHopDong = this.AdvHopDong.Value;
                objSDDKTK.SoDuNoNT = Conversions.ToDouble(this.TxtSoDuNoNT.Value);
                objSDDKTK.SoDuNo = Conversions.ToDouble(this.TxtSoDuNo.Value);
                objSDDKTK.SoDuCoNT = Conversions.ToDouble(this.TxtSoDuCoNT.Value);
                objSDDKTK.SoDuCo = Conversions.ToDouble(this.TxtSoDuCo.Value);
                objSDDKTK.Loai = "TK";
                objSDDKTK.KhoaDonVi = modGeneral.H_CLIENT;
                if (objSDDKTK.Save())
                {
                    objSDDKTK = null;
                    this.Close();
                }
            }
        }

        public void ShowData(object pKhoa)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(pKhoa), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                ClsSoDuDauKyTaiKhoan objSDDKTK = this.objSDDKTK;
                if (objSDDKTK.Load(Conversions.ToString(pKhoa)))
                {
                    objSDDKTK.Load(Conversions.ToString(pKhoa));
                    this.cFrmKhoa = objSDDKTK.Khoa.Trim();
                    this.AdvTaiKhoan.Value = objSDDKTK.KhoaTaiKhoan;
                    EventArgs e = new EventArgs();
                    this.AdvTaiKhoan_ValueChanged(this, e);
                    this.CboLoaiTien.SelectedValue = objSDDKTK.LoaiTien;
                    this.txtTyGia.Value = objSDDKTK.TyGia;
                    this.AdvDoiTuong.Value = objSDDKTK.KhoaDoiTuong;
                    this.AdvBoPhan.Value = objSDDKTK.KhoaBoPhan;
                    this.AdvHopDong.Value = objSDDKTK.KhoaHopDong;
                    this.AdvSanPham.Value = objSDDKTK.KhoaSanPham;
                    this.TxtSoDuCo.Value = objSDDKTK.SoDuCo;
                    this.TxtSoDuCoNT.Value = objSDDKTK.SoDuCoNT;
                    this.TxtSoDuNo.Value = objSDDKTK.SoDuNo;
                    this.TxtSoDuNoNT.Value = objSDDKTK.SoDuNoNT;
                    this.cFrmNamThang = objSDDKTK.NamThang.Trim();
                    objSDDKTK = null;
                }
            }
        }

        private void TxtSoDuCoNT_LostFocus(object sender, EventArgs e)
        {
            double num = 0.0;
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoDuCoNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtSoDuCo.Value = num * num2;
        }

        private void TxtSoDuNoNT_LostFocus(object sender, EventArgs e)
        {
            double num = 0.0;
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoDuNoNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtSoDuNo.Value = num * num2;
        }

        internal virtual ADVList AdvBoPhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvBoPhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvBoPhan = value;
            }
        }

        internal virtual ADVObjects AdvDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvDoiTuong = value;
            }
        }

        internal virtual ADVList AdvHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvHopDong = value;
            }
        }

        internal virtual ADVList AdvSanPham
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvSanPham;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvSanPham = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVAccount.ValueChangedEventHandler handler = new ADVAccount.ValueChangedEventHandler(this.AdvTaiKhoan_ValueChanged);
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged -= handler;
                }
                this._AdvTaiKhoan = value;
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual C1NumericEdit TxtSoDuCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDuCo = value;
            }
        }

        internal virtual C1NumericEdit TxtSoDuCoNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuCoNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoDuCoNT_LostFocus);
                if (this._TxtSoDuCoNT != null)
                {
                    this._TxtSoDuCoNT.LostFocus -= handler;
                }
                this._TxtSoDuCoNT = value;
                if (this._TxtSoDuCoNT != null)
                {
                    this._TxtSoDuCoNT.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtSoDuNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDuNo = value;
            }
        }

        internal virtual C1NumericEdit TxtSoDuNoNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuNoNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoDuNoNT_LostFocus);
                if (this._TxtSoDuNoNT != null)
                {
                    this._TxtSoDuNoNT.LostFocus -= handler;
                }
                this._TxtSoDuNoNT = value;
                if (this._TxtSoDuNoNT != null)
                {
                    this._TxtSoDuNoNT.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }
    }
}

